#ifndef __RAY
#define __RAY

/*
basic definition of a parametric line (here as a ray datatype) and the associated
functions to calculate with it.

mathematical reference:
-----------------------
[1] book title, author(s), ISBN
*/

// INCLUDES -------------------------------------------------------------------------
#include "vector.h" // raytracer datatype "vector", "fNumber"

// DATATYPES ------------------------------------------------------------------------

/* basic ray
   details: [1], p. xxx */
typedef struct
{
	vector o; // origin
	vector d; // direction
} ray;

void rayPrintf(ray* r);			// printf() for ray

// FUNCTIONS ------------------------------------------------------------------------

void rayClear(ray* r);			// r -> o:[0,0,0,1], d:[0,0,-1,1]
void raySet(ray* r, ray* a);	// r = a

// retrieve an arbitrary point p on the line produced by scalar t
void rayPoint(vector* p, ray* r, fNumber t);

#endif // __RAY
